Skip to content

tachyon: degrade reads instead of failing the whome read completely#7

Draft
maurycy wants to merge 11 commits into
mainfrom
tachyon-degrade-gracefully
Draft

tachyon: degrade reads instead of failing the whome read completely#7
maurycy wants to merge 11 commits into
mainfrom
tachyon-degrade-gracefully

Conversation

@maurycy

@maurycy maurycy commented Jul 7, 2026

Copy link
Copy Markdown
Owner
String Field Trigger What is preserved Location field
<unreadable frame> funcname The code object struct itself cannot be read Nothing; filename is set to ~ None
<unknown function> funcname Code object read OK, but the qualname string read failed Filename, if its own read succeeded None
<unknown file> filename Code object read OK, but the filename string read failed Funcname, if its own read succeeded None
(len=N) suffix funcname / filename / task name Longer than the caller's cap: 1024 for qualname and filename, 255 for asyncio task name; first min(len, cap) chars kept, real length appended, eg: very_long_qualnam(len=1100) The truncated prefix; frame is otherwise fully normal (line numbers intact) Normal
(no marker, location dropped) location Linetable read failed, or linetable exceeds MAX_REMOTE_READ (256 KB) Funcname and filename, both real None
~ filename Companion to <unreadable frame>; similar to pstats convention for synthetic entries - None

Fatal v. degrade

Classified by _Py_RemoteDebug_IsFatalReadError():

Exception Meaning Raised by
PermissionError No permissions to read target memory (ptrace scope, KERN_PROTECTION_FAILURE, EPERM/EACCES, ERROR_ACCESS_DENIED) All platforms
ProcessLookupError Target process died (ESRCH; mach task gone / memory space gone) Linux, macOS (it will be a bit different on vm_remap; not sure about Windows
MemoryError Allocation failure? All platforms
Any BaseException not inheriting from Exception KeyboardInterrupt, SystemExit, etc.: All platforms

Everything else (plain OSError such as EFAULT, RuntimeError from corrupted remote data or unknown Mach errors, ValueError from KERN_INVALID_ARGUMENT etc.) is treated as remote read fail

Interaction notes

  • Degraded frames are never cached. Who knows what caused the failure? Maybe it's just transient...
  • Truncated strings are cached, because truncation is deterministic for a given object.
  • If both qualname and filename fail to read, then the frame shows <unknown function> in <unknown file>, and the linetable read is skipped

@maurycy maurycy force-pushed the tachyon-degrade-gracefully branch from 7d98020 to dd0fdc7 Compare July 8, 2026 14:17
@maurycy maurycy changed the title stub degrade Jul 8, 2026
@maurycy maurycy changed the title degrade Tachyon: Do not raise an exception but degrade Jul 8, 2026
@maurycy maurycy changed the title Tachyon: Do not raise an exception but degrade tachyon: degrade Jul 8, 2026
@maurycy maurycy changed the title tachyon: degrade tachyon: degrade reads instead of failing them completely Jul 8, 2026
@maurycy maurycy changed the title tachyon: degrade reads instead of failing them completely tachyon: degrade reads instead of failing the whome read completely Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant